<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-garden-add">
			<div class="form-group">	
				<label class="col-sm-3 control-label">厂商编号：</label>
				<div class="col-sm-8">
					<input id="teaGardenNo" name="teaGardenNo" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">厂商名称：</label>
				<div class="col-sm-8">
					<input id="gardenName" name="gardenName" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">法人代表：</label>
				<div class="col-sm-8">
					<input id="legalPerson" name="legalPerson" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">联系电话：</label>
				<div class="col-sm-8">
					<input id="phone" name="phone" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">生产地点：</label>
				<div class="col-sm-8">
					<input id="productAdd" name="productAdd" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">厂商地址：</label>
				<div class="col-sm-8">
					<input id="address" name="address" class="form-control" type="text">
				</div>
			</div>
		</form>
	</div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "module/garden"
		$("#form-garden-add").validate({
			rules:{
				xxxx:{
					required:true,
				},
				teaGardenNo:{
					required:true,
					minlength: 6,
        			maxlength: 6
				},
				gardenName:{
					required:true,
					maxlength: 128
				},
				legalPerson:{
					required:true,
					maxlength: 64
				},
				phone:{
					required:true,
					isPhone:true,
				},
				productAdd:{
					required:true,
					maxlength: 255
				},
				address:{
					required:true,
					maxlength: 255
				}
				
			}
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/add", $('#form-garden-add').serialize());
	        }
	    }
	</script>
</body>
</html>
